package com.trsj.lnsj.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import com.trsj.lnsj.util.ui.DateToLongStringSerializer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;



@Entity
@Table(name = "tab_activity")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 
public class ActivityDTO implements Serializable{
    @Id
    @GeneratedValue
    private Long id;
    @NotNull
    @Column(name = "name") //活动名称
    private String name;
    @NotNull
    @Column(name = "type") //活动类型(1:福利活动,2:公益活动,3:收费活动
    private String type;
    @NotNull
    @Column(name = "address")
    private String address; //活动地点
    @Column(name = "limit_persons")
    private Integer limitPersons; //上限人数
    @Column(name = "act_organiser")
    private String actOrganiser; //活动发起人
    @Column(name = "act_amount")
    private Float actAmount; //活动金额
    @Column(name = "act_status")
    private String actStatus; //活动状态
    @JsonSerialize(using = DateToLongStringSerializer.class)
    @Column(name = "start_time")
    private Date startTime; //开始时间
    @JsonSerialize(using = DateToLongStringSerializer.class)
    @Column(name = "end_time")
    private Date endTime; //结束时间

    @JsonSerialize(using = DateToLongStringSerializer.class)
    @Column(name = "create_date")
    @Temporal(TemporalType.TIMESTAMP) 
    private Date createDate; //创建时间
    @Column(name = "update_date")
    @JsonSerialize(using = DateToLongStringSerializer.class)
    private Date updateDate; //修改时间

    @Column(name = "image_addr")
    private String imageAddr; //活动图片地址
    @Transient
    private Integer userId;
    @Transient
    private String happyNo;
    @Column(name = "content")
    private String content;//活动内容
    @Column(name = "price")
    private Float price;//价格
    @Column(name = "signup_number") 
    private Integer signupNumber;//已参加人数
    @Column(name = "access")  
    private Integer access;//权限  0 自己 1 其他人 2公开
    @Column(name="group_id")
    private String groupId;
    @Column(name="LAL")
    private String LAL;//经纬度
    @Column(name="phone_number")//活动电话
    private String phoneNumber;
    @Column(name="city")//活动举办城市
    private String city;

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getPhoneNumber() {
    	 return phoneNumber == null ? "":phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getLAL() {
		 return LAL == null ? "":LAL;
	}

	public void setLAL(String lAL) {
		LAL = lAL;
	}

	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name == null ? "":name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type == null ? "":type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAddress() {
        return address == null ? "":address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getLimitPersons() {
        return limitPersons == null ? 0:limitPersons;
    }

    public void setLimitPersons(Integer limitPersons) {
        this.limitPersons = limitPersons;
    }

    public String getActOrganiser() {
        return actOrganiser == null ? "":actOrganiser;
    }

    public void setActOrganiser(String actOrganiser) {
        this.actOrganiser = actOrganiser;
    }


    public Float getActAmount() {
		return actAmount;
	}

	public void setActAmount(Float actAmount) {
		this.actAmount = actAmount;
	}

	public String getContent() {
		return content == null ? "":content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getActStatus() {
        return actStatus == null ? "":actStatus;
    } 

    public void setActStatus(String actStatus) {
        this.actStatus = actStatus;
    }
    


	public String getImageAddr() {
        return imageAddr == null ? "":imageAddr;
    }

    public void setImageAddr(String imageAddr) {
        this.imageAddr = imageAddr;
    }

    public String getHappyNo() {
        return happyNo == null ? "":happyNo;
    }

    public void setHappyNo(String happyNo) {
        this.happyNo = happyNo;
    }

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Integer getSignupNumber() {
		return signupNumber == null ? 0:signupNumber;
	}

	public void setSignupNumber(Integer signupNumber) {
		this.signupNumber = signupNumber;
	}

	public Integer getAccess() {
		return access == null ? 0 : access;
	}

	public void setAccess(Integer access) {
		this.access = access;
	}




    public String getGroupId() {
    	 return groupId == null ? "":groupId;
	
	}

	public Integer getUserId() {
		 return userId == null ? 0:userId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCity() {
        return city == null ? "":city;
    }

    public void setCity(String city) {
        this.city = city;
    }

}
